Skip to content

chore: migrate rust/qrcode to icp-cli#1401

Merged
raymondk merged 6 commits into
masterfrom
chore/migrate-rust-qrcode-to-icp-cli
Jun 19, 2026
Merged

chore: migrate rust/qrcode to icp-cli#1401
raymondk merged 6 commits into
masterfrom
chore/migrate-rust-qrcode-to-icp-cli

Conversation

@marc0olo

@marc0olo marc0olo commented Jun 16, 2026

Copy link
Copy Markdown
Member

Summary

Migrates rust/qrcode from dfx to icp-cli.

Removed: dfx.json, BUILD.md, webpack.config.js, .devcontainer/, old src/ directory, old Makefile

Changed:

  • Rust source moved from src/qrcode_backend/ to backend/; package renamed to backend
  • Frontend rewritten from webpack + dfx declarations to Vite + @icp-sdk/bindgen; actor wiring updated to use safeGetCanisterEnv / ic_env cookie pattern
  • .ic-assets.json5 consolidated from two copies (old setup served two asset roots) into one at frontend/public/; connect-src updated from icp0.io to icp-api.io

Added:

  • icp.yaml with @dfinity/rust@v3.3.0 (backend) and @dfinity/asset-canister@v2.2.1 (frontend)
  • test.sh with 7 tests: 6 --query calls covering all option combinations + 1 update call
  • CI workflow .github/workflows/qrcode.yml using icp-dev-env-rust:1.0.1

Test plan

  • icp network start -d && icp deploy && bash test.sh passes
  • Frontend builds and renders QR codes in browser

🤖 Generated with Claude Code

@marc0olo marc0olo force-pushed the chore/migrate-rust-qrcode-to-icp-cli branch from f082aa2 to 64f5730 Compare June 17, 2026 17:00
marc0olo and others added 2 commits June 19, 2026 08:32
Replaces dfx.json with icp.yaml using @dfinity/rust@v3.3.0 and
@dfinity/asset-canister@v2.2.1 recipes. Moves Rust source to backend/,
rewrites frontend to Vite + @icp-sdk/bindgen, updates Makefile tests to
use icp canister call, adds CI workflow, and removes dfx artifacts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@marc0olo marc0olo force-pushed the chore/migrate-rust-qrcode-to-icp-cli branch from 64f5730 to 305d50b Compare June 19, 2026 06:34
marc0olo and others added 2 commits June 19, 2026 15:32
The bindgen-generated binding expects add_transparency?: boolean and
converts it to opt bool internally via candid_some/candid_none.
Wrapping the value in an array made it [false] (truthy), causing the
binding to encode it as [[false]] which is invalid for opt bool.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@marc0olo marc0olo marked this pull request as ready for review June 19, 2026 13:39
@marc0olo marc0olo requested review from a team as code owners June 19, 2026 13:40
marc0olo and others added 2 commits June 19, 2026 15:44
The file was dropped during migration but is not dfx-specific — it is
read by the asset canister and sets important security headers (CSP,
X-Frame-Options, Referrer-Policy, etc.).

Placed in frontend/public/ so Vite copies it to dist/ unchanged.
Only one copy is needed (vs two in the old dfx setup which served
both assets/ and src/ as separate roots).

Updated icp0.io references to icp.net in CSP and allow_raw_access comment.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
icp.net is the frontend hosting domain; icp-api.io is the API endpoint
used for canister calls. Updated both the CSP value and the comment.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@raymondk raymondk merged commit c0a31b4 into master Jun 19, 2026
6 checks passed
@raymondk raymondk deleted the chore/migrate-rust-qrcode-to-icp-cli branch June 19, 2026 20:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants